\(\int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx\) [59]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 24, antiderivative size = 109 \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=-\frac {8 i (a+i a \tan (c+d x))^9}{9 a^4 d}+\frac {6 i (a+i a \tan (c+d x))^{10}}{5 a^5 d}-\frac {6 i (a+i a \tan (c+d x))^{11}}{11 a^6 d}+\frac {i (a+i a \tan (c+d x))^{12}}{12 a^7 d} \]

[Out]

-8/9*I*(a+I*a*tan(d*x+c))^9/a^4/d+6/5*I*(a+I*a*tan(d*x+c))^10/a^5/d-6/11*I*(a+I*a*tan(d*x+c))^11/a^6/d+1/12*I*
(a+I*a*tan(d*x+c))^12/a^7/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 45} \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=\frac {i (a+i a \tan (c+d x))^{12}}{12 a^7 d}-\frac {6 i (a+i a \tan (c+d x))^{11}}{11 a^6 d}+\frac {6 i (a+i a \tan (c+d x))^{10}}{5 a^5 d}-\frac {8 i (a+i a \tan (c+d x))^9}{9 a^4 d} \]

[In]

Int[Sec[c + d*x]^8*(a + I*a*Tan[c + d*x])^5,x]

[Out]

(((-8*I)/9)*(a + I*a*Tan[c + d*x])^9)/(a^4*d) + (((6*I)/5)*(a + I*a*Tan[c + d*x])^10)/(a^5*d) - (((6*I)/11)*(a
 + I*a*Tan[c + d*x])^11)/(a^6*d) + ((I/12)*(a + I*a*Tan[c + d*x])^12)/(a^7*d)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \text {Subst}\left (\int (a-x)^3 (a+x)^8 \, dx,x,i a \tan (c+d x)\right )}{a^7 d} \\ & = -\frac {i \text {Subst}\left (\int \left (8 a^3 (a+x)^8-12 a^2 (a+x)^9+6 a (a+x)^{10}-(a+x)^{11}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^7 d} \\ & = -\frac {8 i (a+i a \tan (c+d x))^9}{9 a^4 d}+\frac {6 i (a+i a \tan (c+d x))^{10}}{5 a^5 d}-\frac {6 i (a+i a \tan (c+d x))^{11}}{11 a^6 d}+\frac {i (a+i a \tan (c+d x))^{12}}{12 a^7 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.84 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.74 \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=\frac {a^5 \sec ^{12}(c+d x) (78 \cos (c+d x)+221 \cos (3 (c+d x))-3 i (18 \sin (c+d x)+73 \sin (3 (c+d x)))) (-i \cos (9 (c+d x))+\sin (9 (c+d x)))}{1980 d} \]

[In]

Integrate[Sec[c + d*x]^8*(a + I*a*Tan[c + d*x])^5,x]

[Out]

(a^5*Sec[c + d*x]^12*(78*Cos[c + d*x] + 221*Cos[3*(c + d*x)] - (3*I)*(18*Sin[c + d*x] + 73*Sin[3*(c + d*x)]))*
((-I)*Cos[9*(c + d*x)] + Sin[9*(c + d*x)]))/(1980*d)

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 376 vs. \(2 (93 ) = 186\).

Time = 1.15 (sec) , antiderivative size = 377, normalized size of antiderivative = 3.46

\[\frac {i a^{5} \left (\frac {\sin ^{6}\left (d x +c \right )}{12 \cos \left (d x +c \right )^{12}}+\frac {\sin ^{6}\left (d x +c \right )}{20 \cos \left (d x +c \right )^{10}}+\frac {\sin ^{6}\left (d x +c \right )}{40 \cos \left (d x +c \right )^{8}}+\frac {\sin ^{6}\left (d x +c \right )}{120 \cos \left (d x +c \right )^{6}}\right )+5 a^{5} \left (\frac {\sin ^{5}\left (d x +c \right )}{11 \cos \left (d x +c \right )^{11}}+\frac {2 \left (\sin ^{5}\left (d x +c \right )\right )}{33 \cos \left (d x +c \right )^{9}}+\frac {8 \left (\sin ^{5}\left (d x +c \right )\right )}{231 \cos \left (d x +c \right )^{7}}+\frac {16 \left (\sin ^{5}\left (d x +c \right )\right )}{1155 \cos \left (d x +c \right )^{5}}\right )-10 i a^{5} \left (\frac {\sin ^{4}\left (d x +c \right )}{10 \cos \left (d x +c \right )^{10}}+\frac {3 \left (\sin ^{4}\left (d x +c \right )\right )}{40 \cos \left (d x +c \right )^{8}}+\frac {\sin ^{4}\left (d x +c \right )}{20 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{4}\left (d x +c \right )}{40 \cos \left (d x +c \right )^{4}}\right )-10 a^{5} \left (\frac {\sin ^{3}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}+\frac {2 \left (\sin ^{3}\left (d x +c \right )\right )}{21 \cos \left (d x +c \right )^{7}}+\frac {8 \left (\sin ^{3}\left (d x +c \right )\right )}{105 \cos \left (d x +c \right )^{5}}+\frac {16 \left (\sin ^{3}\left (d x +c \right )\right )}{315 \cos \left (d x +c \right )^{3}}\right )+\frac {5 i a^{5}}{8 \cos \left (d x +c \right )^{8}}-a^{5} \left (-\frac {16}{35}-\frac {\left (\sec ^{6}\left (d x +c \right )\right )}{7}-\frac {6 \left (\sec ^{4}\left (d x +c \right )\right )}{35}-\frac {8 \left (\sec ^{2}\left (d x +c \right )\right )}{35}\right ) \tan \left (d x +c \right )}{d}\]

[In]

int(sec(d*x+c)^8*(a+I*a*tan(d*x+c))^5,x)

[Out]

1/d*(I*a^5*(1/12*sin(d*x+c)^6/cos(d*x+c)^12+1/20*sin(d*x+c)^6/cos(d*x+c)^10+1/40*sin(d*x+c)^6/cos(d*x+c)^8+1/1
20*sin(d*x+c)^6/cos(d*x+c)^6)+5*a^5*(1/11*sin(d*x+c)^5/cos(d*x+c)^11+2/33*sin(d*x+c)^5/cos(d*x+c)^9+8/231*sin(
d*x+c)^5/cos(d*x+c)^7+16/1155*sin(d*x+c)^5/cos(d*x+c)^5)-10*I*a^5*(1/10*sin(d*x+c)^4/cos(d*x+c)^10+3/40*sin(d*
x+c)^4/cos(d*x+c)^8+1/20*sin(d*x+c)^4/cos(d*x+c)^6+1/40*sin(d*x+c)^4/cos(d*x+c)^4)-10*a^5*(1/9*sin(d*x+c)^3/co
s(d*x+c)^9+2/21*sin(d*x+c)^3/cos(d*x+c)^7+8/105*sin(d*x+c)^3/cos(d*x+c)^5+16/315*sin(d*x+c)^3/cos(d*x+c)^3)+5/
8*I*a^5/cos(d*x+c)^8-a^5*(-16/35-1/7*sec(d*x+c)^6-6/35*sec(d*x+c)^4-8/35*sec(d*x+c)^2)*tan(d*x+c))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 267 vs. \(2 (85) = 170\).

Time = 0.23 (sec) , antiderivative size = 267, normalized size of antiderivative = 2.45 \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=-\frac {1024 \, {\left (-495 i \, a^{5} e^{\left (16 i \, d x + 16 i \, c\right )} - 792 i \, a^{5} e^{\left (14 i \, d x + 14 i \, c\right )} - 924 i \, a^{5} e^{\left (12 i \, d x + 12 i \, c\right )} - 792 i \, a^{5} e^{\left (10 i \, d x + 10 i \, c\right )} - 495 i \, a^{5} e^{\left (8 i \, d x + 8 i \, c\right )} - 220 i \, a^{5} e^{\left (6 i \, d x + 6 i \, c\right )} - 66 i \, a^{5} e^{\left (4 i \, d x + 4 i \, c\right )} - 12 i \, a^{5} e^{\left (2 i \, d x + 2 i \, c\right )} - i \, a^{5}\right )}}{495 \, {\left (d e^{\left (24 i \, d x + 24 i \, c\right )} + 12 \, d e^{\left (22 i \, d x + 22 i \, c\right )} + 66 \, d e^{\left (20 i \, d x + 20 i \, c\right )} + 220 \, d e^{\left (18 i \, d x + 18 i \, c\right )} + 495 \, d e^{\left (16 i \, d x + 16 i \, c\right )} + 792 \, d e^{\left (14 i \, d x + 14 i \, c\right )} + 924 \, d e^{\left (12 i \, d x + 12 i \, c\right )} + 792 \, d e^{\left (10 i \, d x + 10 i \, c\right )} + 495 \, d e^{\left (8 i \, d x + 8 i \, c\right )} + 220 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 66 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 12 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

[In]

integrate(sec(d*x+c)^8*(a+I*a*tan(d*x+c))^5,x, algorithm="fricas")

[Out]

-1024/495*(-495*I*a^5*e^(16*I*d*x + 16*I*c) - 792*I*a^5*e^(14*I*d*x + 14*I*c) - 924*I*a^5*e^(12*I*d*x + 12*I*c
) - 792*I*a^5*e^(10*I*d*x + 10*I*c) - 495*I*a^5*e^(8*I*d*x + 8*I*c) - 220*I*a^5*e^(6*I*d*x + 6*I*c) - 66*I*a^5
*e^(4*I*d*x + 4*I*c) - 12*I*a^5*e^(2*I*d*x + 2*I*c) - I*a^5)/(d*e^(24*I*d*x + 24*I*c) + 12*d*e^(22*I*d*x + 22*
I*c) + 66*d*e^(20*I*d*x + 20*I*c) + 220*d*e^(18*I*d*x + 18*I*c) + 495*d*e^(16*I*d*x + 16*I*c) + 792*d*e^(14*I*
d*x + 14*I*c) + 924*d*e^(12*I*d*x + 12*I*c) + 792*d*e^(10*I*d*x + 10*I*c) + 495*d*e^(8*I*d*x + 8*I*c) + 220*d*
e^(6*I*d*x + 6*I*c) + 66*d*e^(4*I*d*x + 4*I*c) + 12*d*e^(2*I*d*x + 2*I*c) + d)

Sympy [F]

\[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=i a^{5} \left (\int \left (- i \sec ^{8}{\left (c + d x \right )}\right )\, dx + \int 5 \tan {\left (c + d x \right )} \sec ^{8}{\left (c + d x \right )}\, dx + \int \left (- 10 \tan ^{3}{\left (c + d x \right )} \sec ^{8}{\left (c + d x \right )}\right )\, dx + \int \tan ^{5}{\left (c + d x \right )} \sec ^{8}{\left (c + d x \right )}\, dx + \int 10 i \tan ^{2}{\left (c + d x \right )} \sec ^{8}{\left (c + d x \right )}\, dx + \int \left (- 5 i \tan ^{4}{\left (c + d x \right )} \sec ^{8}{\left (c + d x \right )}\right )\, dx\right ) \]

[In]

integrate(sec(d*x+c)**8*(a+I*a*tan(d*x+c))**5,x)

[Out]

I*a**5*(Integral(-I*sec(c + d*x)**8, x) + Integral(5*tan(c + d*x)*sec(c + d*x)**8, x) + Integral(-10*tan(c + d
*x)**3*sec(c + d*x)**8, x) + Integral(tan(c + d*x)**5*sec(c + d*x)**8, x) + Integral(10*I*tan(c + d*x)**2*sec(
c + d*x)**8, x) + Integral(-5*I*tan(c + d*x)**4*sec(c + d*x)**8, x))

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.47 \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=-\frac {-165 i \, a^{5} \tan \left (d x + c\right )^{12} - 900 \, a^{5} \tan \left (d x + c\right )^{11} + 1386 i \, a^{5} \tan \left (d x + c\right )^{10} - 1100 \, a^{5} \tan \left (d x + c\right )^{9} + 5445 i \, a^{5} \tan \left (d x + c\right )^{8} + 3960 \, a^{5} \tan \left (d x + c\right )^{7} + 4620 i \, a^{5} \tan \left (d x + c\right )^{6} + 8712 \, a^{5} \tan \left (d x + c\right )^{5} - 2475 i \, a^{5} \tan \left (d x + c\right )^{4} + 4620 \, a^{5} \tan \left (d x + c\right )^{3} - 4950 i \, a^{5} \tan \left (d x + c\right )^{2} - 1980 \, a^{5} \tan \left (d x + c\right )}{1980 \, d} \]

[In]

integrate(sec(d*x+c)^8*(a+I*a*tan(d*x+c))^5,x, algorithm="maxima")

[Out]

-1/1980*(-165*I*a^5*tan(d*x + c)^12 - 900*a^5*tan(d*x + c)^11 + 1386*I*a^5*tan(d*x + c)^10 - 1100*a^5*tan(d*x
+ c)^9 + 5445*I*a^5*tan(d*x + c)^8 + 3960*a^5*tan(d*x + c)^7 + 4620*I*a^5*tan(d*x + c)^6 + 8712*a^5*tan(d*x +
c)^5 - 2475*I*a^5*tan(d*x + c)^4 + 4620*a^5*tan(d*x + c)^3 - 4950*I*a^5*tan(d*x + c)^2 - 1980*a^5*tan(d*x + c)
)/d

Giac [A] (verification not implemented)

none

Time = 0.86 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.47 \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=-\frac {-165 i \, a^{5} \tan \left (d x + c\right )^{12} - 900 \, a^{5} \tan \left (d x + c\right )^{11} + 1386 i \, a^{5} \tan \left (d x + c\right )^{10} - 1100 \, a^{5} \tan \left (d x + c\right )^{9} + 5445 i \, a^{5} \tan \left (d x + c\right )^{8} + 3960 \, a^{5} \tan \left (d x + c\right )^{7} + 4620 i \, a^{5} \tan \left (d x + c\right )^{6} + 8712 \, a^{5} \tan \left (d x + c\right )^{5} - 2475 i \, a^{5} \tan \left (d x + c\right )^{4} + 4620 \, a^{5} \tan \left (d x + c\right )^{3} - 4950 i \, a^{5} \tan \left (d x + c\right )^{2} - 1980 \, a^{5} \tan \left (d x + c\right )}{1980 \, d} \]

[In]

integrate(sec(d*x+c)^8*(a+I*a*tan(d*x+c))^5,x, algorithm="giac")

[Out]

-1/1980*(-165*I*a^5*tan(d*x + c)^12 - 900*a^5*tan(d*x + c)^11 + 1386*I*a^5*tan(d*x + c)^10 - 1100*a^5*tan(d*x
+ c)^9 + 5445*I*a^5*tan(d*x + c)^8 + 3960*a^5*tan(d*x + c)^7 + 4620*I*a^5*tan(d*x + c)^6 + 8712*a^5*tan(d*x +
c)^5 - 2475*I*a^5*tan(d*x + c)^4 + 4620*a^5*tan(d*x + c)^3 - 4950*I*a^5*tan(d*x + c)^2 - 1980*a^5*tan(d*x + c)
)/d

Mupad [B] (verification not implemented)

Time = 4.23 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.34 \[ \int \sec ^8(c+d x) (a+i a \tan (c+d x))^5 \, dx=\frac {a^5\,\left (-{\cos \left (c+d\,x\right )}^{12}\,1749{}\mathrm {i}+2048\,\sin \left (c+d\,x\right )\,{\cos \left (c+d\,x\right )}^{11}+1024\,\sin \left (c+d\,x\right )\,{\cos \left (c+d\,x\right )}^9+768\,\sin \left (c+d\,x\right )\,{\cos \left (c+d\,x\right )}^7+640\,\sin \left (c+d\,x\right )\,{\cos \left (c+d\,x\right )}^5+{\cos \left (c+d\,x\right )}^4\,3960{}\mathrm {i}-3400\,\sin \left (c+d\,x\right )\,{\cos \left (c+d\,x\right )}^3-{\cos \left (c+d\,x\right )}^2\,2376{}\mathrm {i}+900\,\sin \left (c+d\,x\right )\,\cos \left (c+d\,x\right )+165{}\mathrm {i}\right )}{1980\,d\,{\cos \left (c+d\,x\right )}^{12}} \]

[In]

int((a + a*tan(c + d*x)*1i)^5/cos(c + d*x)^8,x)

[Out]

(a^5*(900*cos(c + d*x)*sin(c + d*x) - 3400*cos(c + d*x)^3*sin(c + d*x) + 640*cos(c + d*x)^5*sin(c + d*x) + 768
*cos(c + d*x)^7*sin(c + d*x) + 1024*cos(c + d*x)^9*sin(c + d*x) + 2048*cos(c + d*x)^11*sin(c + d*x) - cos(c +
d*x)^2*2376i + cos(c + d*x)^4*3960i - cos(c + d*x)^12*1749i + 165i))/(1980*d*cos(c + d*x)^12)